package spring.cloud.tasks.executor.executor.task;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.common.curator.Curator;
import spring.cloud.tasks.executor.executor.task.task_configuration.TaskConfiguration;

@Slf4j
@Setter
@Getter
public abstract class TaskListenerHolder implements Lifecycle {
    public Curator curator;
    public String executorId;
    //
    public String taskId;
    public TaskConfiguration taskConfiguration;
    public TaskExecutor taskExecutor;
    public TaskExecutorNodeCacheOrTreeCacheManager taskExecutorNodeCacheOrTreeCacheManager;


    public TaskListenerHolder(final TaskExecutor taskExecutor) {
        this.curator = taskExecutor.getCurator();
        this.executorId = taskExecutor.getExecutorId();
        this.taskId = taskExecutor.getTaskId();
        this.taskConfiguration = taskExecutor.getTaskConfiguration();
        this.taskExecutor = taskExecutor;
        this.taskExecutorNodeCacheOrTreeCacheManager = taskExecutor.getTaskExecutorNodeCacheOrTreeCacheManager();

    }

    @Override
    public abstract void start();

    @Override
    public void stop() {
    }
}
